package com.bd.scm.module.authority.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bd.scm.dao.mapper.authority.AuthorityMapper;
import com.bd.scm.domain.dto.authority.AuthorityDto;
import com.bd.scm.domain.models.authority.Authority;
import com.bd.scm.module.authority.service.AuthorityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**权限管理ServiceImol
 * @ClassName AuthorityServiceImol
 * @Description TODO
 * @Author YH
 * @Date 2020/5/7 0007 14:54
 * @Version 1.0
 **/
@Service
public class AuthorityServiceImol extends ServiceImpl<AuthorityMapper, Authority> implements AuthorityService {

  @Autowired
  private AuthorityMapper authorityMapper;

  /**
   * 根据登录人分组编号与菜单编号查询权限
   * @param authorityDto groupNo 登录人分组编号 menuBh 菜单编号
   * @return 权限代码
   */
  @Override
  public List<JSONObject> findAuthorityMenuSet(AuthorityDto authorityDto) {
    String authorityMenuSet = this.authorityMapper.findAuthorityMenuSet(authorityDto);
    return this.authorityMapper.findAuthorityList(authorityMenuSet);
  }
}
